{extend name="common/base" /}

{block name="style"}
<style>
    body{
        background: #F5F5F5;
        touch-action: none;
        overflow-y: scroll;
    }

</style>
{/block}
{block name="body"}
<div class="wddd-mains" >
    <div id="pullrefresh" {neq name="user_box_id" value="0"}style="margin-top:0.6rem;"{/neq} class="mui-scroll-wrapper">
        <div class="mui-scroll">
            <ul class="wddd-nav">
                {foreach $order_list as $vo }
                <a href="{:url('detail',['id'=>$vo['order_id']])}">

                    <li>
                        <div class="wd-nav-le">
                            <p class="nav-le-ps">{$vo.createtime}</p>
                            <div class="nav-le-lis">
                                {foreach $vo.goods_list as $goods }

                                <img src="__OSSCDN__{$goods.goods_logo}" class="lis-img">

                                {/foreach}
                            </div>
                        </div>
                        <div class="wd-nav-cen">共{$vo.goods_count}件</div>
                        <div class="wd-nav-rig">
                            <p class="rig-ps1">
                                {switch name="$vo.status"}
                                {case value="0"}
                                待支付
                                {/case}
                                {case value="10"}
                                已完成
                                {/case}
                                {case value="20"}
                                已取消
                                {/case}

                                {/switch}
                            </p>
                            <p class="rig-ps2">{$vo.real_price}元</p>
                            <p class="rig-ps3 js-jump">查看详情</p>

                        </div>
                    </li>
                </a>
                {/foreach}
            </ul>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    mui('body').on('tap', 'a', function () {
        window.top.location.href = this.href;
    });
    var p = 1;
    var loading = false;  //状态标记
    mui.init({
        pullRefresh: {
            container: '#pullrefresh',
            up: {
                height: 50, //可选.默认50.触发上拉加载拖动距离
                contentrefresh: '正在加载...',
                contentnomore: '没有更多了', //可选，请求完毕若没有更多数据时显示的提醒内容；
                callback: pullupRefresh
            }
        }
    });

    /**
     * 上拉加载具体业务实现
     */
    function pullupRefresh() {
        $.post("{:url('orderItem')}", {p: p}, function (res) {
            if (res) {
                $(".wddd-nav").append(res);
                p++;
                mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); //参数为true代表没有更多数据了。
            } else {
                mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); //参数为true代表没有更多数据了。
            }
        }, 'json');

    }

    $('.js-jump').on('click', function () {
        console.log(123);

    });

    $(document).on('click', '.js-jump', function () {
        console.log(123);
        var url = $(this).attr('data-url');
        location.href = url;

    });
</script>
{/block}